/**
@author		Jong Min, Lee
@date		  02/12/2014
@breif		study tab property

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#pragma once

#include <vector>
#include "Taurus_Util/Macros.h"
#include "Taurus_Util/TUTypes.h"

class CStudyTabProperty
{
private:
  /**
  @brief		default contructor
  */
  CStudyTabProperty();

  DISALLOW_COPY_AND_ASSIGN(CStudyTabProperty);

public:
  typedef struct CFontProperty
  {
    int thePointSize;

    CString theFaceName;
  }CFontProperty;

  /**
  @brief		destructor
  */
  ~CStudyTabProperty();

  /**
  @brief		access to the single instance of study tab property
  @return		pointer to the single instance of study tab property
  */
  static CStudyTabProperty* getInstance();

  /**
  @brief		import study tab property xml node in viewer property
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD importProperty();

  /**
  @brief		export study tab property to viewer property
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD exportProperty();

  /**
  @brief		get maximum number of tabs
  @return		the maximum number of tabs
  */
  inline unsigned int getMaxNumTabs() const
  {
    return m_theMaxNumTabs;
  }

  /**
  @brief		set maximum number of tabs
  @param		num maximum number of tabs
  */
  inline void setMaxNumTabs(const unsigned int num)
  {
    m_theMaxNumTabs;
  }

  /**
  @brief		get visibility of study tab on a monitor
  @param		index the index number of monitor
  @param    visible variable in which the visibility of study tab is stored
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD getVisibility(const unsigned int index, BOOL& visible) const;

  /**
  @brief		set visibility of study tab on a monitor
  @param		index the index number of monitor
  @param    visible flag indicating the visiblity of study tab
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD setVisibility(const unsigned int index, BOOL visible);

  /**
  @brief		get study tab height
  @param		resType monitor resolution type
  @return		height of study tab
  */
  int getTabHeight(MonitorResolutionType resType) const;

  /**
  @brief		get font preoperty according to monitor resolution type
  @param		resType monitor resolution type
  @return		font property
  */
  CFontProperty getFontProperty(MonitorResolutionType resType) const;

private:
  /**
  @brief		initialize toolbar property
  */
  void init();

  /**
  @brief		destroy study tab property. this function should be used in destructor.
  */
  void destroy();

private:

  //pointer to the single instance of study tab property
  static CStudyTabProperty* m_theInstance;

  //maximum number of tabs
  unsigned int m_theMaxNumTabs;

  //visibility
  std::vector<BOOL> m_theVisibilities;
};
